export function wxPay(jsConfig) {
	uni.showLoading({
		title:'支付中...'
	})
	return new Promise((resolve, reject) => {
		// #ifdef MP
		uni.requestPayment({
			timeStamp: jsConfig.timestamp,
			nonceStr: jsConfig.nonceStr,
			package: jsConfig.package,
			signType: jsConfig.signType,
			paySign: jsConfig.paySign,
			success: function(res) {
				resolve(res)
			},
			fail: function(e) {
				reject(e)
			},
			complete: function(e) {
				uni.hideLoading();
			},
		})
		// #endif

		// #ifdef APP-PLUS
		uni.requestPayment({
			provider: 'wxpay',
			orderInfo: jsConfig,
			success: function(res) {
				resolve(res)
			},
			fail: function(e) {
				reject(e)
			},
			complete: () => {
				uni.hideLoading();
			},
		});
		// #endif

	})
}
